package com.crm.jdy.service.client;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.crm.jdy.common.dto.ClientIncomeInfoDto;
import com.crm.jdy.common.pojo.ClientChargeInfo;
import com.crm.jdy.common.pojo.ClientIncomeInfo;
import com.crm.jdy.common.mapper.ClientIncomeInfoMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;

import java.util.List;

/**   
 * @Description:(回款信息服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class ClientIncomeInfoServiceImpl  extends ServiceImpl<ClientIncomeInfoMapper,ClientIncomeInfo> implements ClientIncomeInfoService  {

    @Autowired
    ClientIncomeInfoMapper clientIncomeInfoDao;

    @Override
    public PageInfo<ClientIncomeInfo> seleteClientIncomeInfo(ClientIncomeInfoDto clientinfo) {
           PageHelper.startPage( clientinfo.getCurrentPage(),clientinfo.getPageSize());
           List<ClientIncomeInfo> bookList = clientIncomeInfoDao.seleteClientInfo(clientinfo);
           PageInfo<ClientIncomeInfo> pageInfo = new PageInfo<ClientIncomeInfo>(bookList);
         return pageInfo;
    }

    @Override
    public boolean updateClientIncomeInfo(ClientIncomeInfo clientinfo) {
        return clientIncomeInfoDao.updateById(clientinfo) > 0;
    }

    @Override
    public boolean addClientIncomeInfo(ClientIncomeInfo clientinfo) {
        return clientIncomeInfoDao.insert(clientinfo) > 0;
    }

    @Override
    public boolean removeClientIncomeInfo(String incomeId) {
        return clientIncomeInfoDao.deleteById(incomeId) > 0;
    }

}